home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swaga_c.zip / CRT.SWG / 0004_Clear VGA Screen.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  660b  |  28 lines

  1. {
  2. >> Does anyone know how to clear the screen Really fast ?
  3. >> I'm working in VGA-mode With a resolution of 320*200*256
  4. > You could try a block rewriting of the palettes, but that would probably
  5. > take even longer, since it is usually an interrupt instruction.
  6.  
  7. Well, use the standard pascal routine called FillChar. ;-)
  8. }
  9.  
  10. FillChar(Mem[$A000:$0000],320*200,0);
  11.  
  12. { You can double speed by using 16 bit wide data transfer: }
  13.  
  14. Procedure FillChar16(Var X;Count : Word;Value : Byte); Assembler;
  15. Asm
  16.   les   di,X
  17.   mov   cd,Count
  18.   shr   cx,1
  19.   mov   al,Value
  20.   mov   ah,al
  21.   rep   stosw
  22.   test  Count,1
  23.   jz    @end
  24.   stosb
  25. @end:
  26. end;
  27.  
  28.